package com.lpc.fragmenttest;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void click2(View view) {

        MyDialogFragment fragment = new MyDialogFragment();
        fragment.show(getSupportFragmentManager(), "MyDialogFragment");

//        AlertDialog.Builder builder = new AlertDialog.Builder(this);
//        builder.setTitle("提示");
//        builder.setMessage("message");
//        builder.setPositiveButton("ok", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialogInterface, int i) {
//
//                Toast.makeText(MainActivity.this, "ok1", Toast.LENGTH_SHORT).show();
//            }
//        });
//        builder.setNegativeButton("cancle", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialogInterface, int i) {
//
//                Toast.makeText(MainActivity.this, "cancle1", Toast.LENGTH_SHORT).show();
//            }
//        });
//        builder.show();
    }

    public void click(View view) {

        MyDialogFragment fragment = new MyDialogFragment();
        fragment.show(getSupportFragmentManager(), "MyDialogFragment");
    }
}
